<template>
  <a-drawer
    :closable="false"
    :visible="visible"
    :width="1100"
    :body-style="{
        padding: 0,
        height: '100%',
        background: '#f7f7f7',
      }"
    :destroyOnClose="true"
    :headerStyle="{ padding: 0 }"
    @close="handleClose"
  >
    <new-turnover
      :turnoverDetail="turnoverDetail"
      :isDrawer="true"
      @cancel="handleClose"
      @save="saveAddTurnover"
      :ownerIdByDrawer="ownerId"
      :queryBillId="queryBillId"
      :queryType="queryType"
      :defaultLoanType="defaultLoanType"
      :defaultAmount="defaultAmount"
    />
  </a-drawer>
</template>

<script>
import {
  defineComponent,
  reactive,
  watch,
  toRefs,
  computed,
  toRaw,
  createVNode,
} from "vue";
import request from "../../../../common/utils/request";
import store from "../../../../store";
import NewTurnover from "@/views/bill/NewTurnover/index.vue";

export default defineComponent({
  name: "AddBillTurnoverDrawer",
  components: {NewTurnover},
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    turnoverDetail: {
      type: Object,
      default: () => ({}),
    },
    ownerId: {
      type: [String, Number],
      default: 0,
    },
    queryBillId: {
      type: [String, Number],
      default: 0,
    },
    queryType: {
      type: String,
      default: '',
    },
    defaultLoanType: {
      type: String,
      default: '',
    },
    defaultAmount: {
      type: Number,
      default: 0,
    }
  },
  setup(props, {emit}) {
    const handleClose = () => {
      emit('handleClose')
    };

    const saveAddTurnover = () => {
      emit('handleSuccess')
    };


    return {
      handleClose,
      saveAddTurnover,
    };
  },
});
</script>
<style lang="less" scoped>

</style>
